`<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=">
<title>后台管理系统</title>
<link rel="stylesheet" href="__PUBLIC__/Admin/css/css.css">
<script src="__PUBLIC__/Admin/js/jquery-1.9.1.js"></script>
<script src="__PUBLIC__/Common/Layer/layer.js"></script>
<script>
//刷新
function refresh(){
	window.location.href = window.location.href;
}
//删除用户
function del(id){
	$("#del"+id+" td").css('background','#CBDFF2');
	parent.layer.confirm('真的要删除吗？', {
		btn: ['确认','取消'], //按钮
		shade: 0.5 //显示遮罩
	}, function(){
		$.post("{:U('Article/article_del')}", { "id": id},function(data){
			if(data.code == 1){
				parent.layer.msg('删除成功', { icon: 1, time: 1000 }, function(){
						$("#del"+id).remove();
					});
			}else{
				parent.layer.msg('删除失败', {icon: 2, time: 2000 }); 
			}
		}, "json");
	},function(){
		$("#del"+id+" td").css('border-top','0');
		$("#del"+id+" td").css('border-bottom','1px solid #EFEFEF');
	});
}
//编辑活动
function edit(id){
	window.location.href = "{:U('Article/single_edit')}?id="+id;
}

//排序
function sort(){
	var str_id = '';
	var str_sort = '';
	$('input[name="id"]').each(function(){
		var id = $(this).val();
 		var sort_num = $('#sort_num'+id).val();
		str_id +=  ','+id;
		str_sort += ','+sort_num;
	});
	$.get("{:U('Article/article_sort')}", { str_id: str_id,str_sort:str_sort },function(data){
		if(data == 1){
			parent.layer.msg('排序成功', {
				icon: 1,
				shade: 0.3,
				time: 2000 //2秒关闭（如果不配置，默认是3秒）
			}, function(){
				window.location.href="__SELF__";
			});
		}else{
			layer.msg('排序失败');
		}
	});
}
</script>
<script>
	function show(a){
		parent.layer.open({
	        	type: 2,
	        	title: '单页详情',
	        	shadeClose: false,
	        	shade: 0.8,
	       	area: ['800px', '500px'],
	       	content:'{:U('Article/single_details')}?id='+a,
	    }); 
	}
</script>
</head>
<body>

<div class="nav">
	<div class="nav_title">
    	<h4><img class="nav_img" src="__PUBLIC__/Admin/img/tab.gif" /><span class="nav_a"><php>echo urldecode($_GET['menu_title']);</php></span></h4>
    </div>
</div>

<div class="list">
	  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="list_table">
      <thead>
	    <tr>
	      <td width="12%"><div align="center">排序</div></td>
          <td width="19%"><div align="center">标题</div></td>	      
          <td width="19%"><div align="center">类型</div></td>	      
	      <td width="14%"><div align="center">创建时间</div></td>
	      <td width="22%"><div align="center">操作</div></td>
        </tr>
        </thead>
        <tbody>
        <foreach name="list" item="vo">
	    <tr id="del{$vo.id}">
	      <td height="50"><div align="center">{$vo.id}</div></td>
          <td><div align="center"><a href="javascript:;" onclick="show({$vo.id})">{$vo.single_title}</a></div></td>	      
	      <td><div align="center">{$vo.type}</div></td>
	      <td><div align="center">{$vo.create_time|date="Y-m-d H:i:s",###}</div></td>
	      <td><div align="center"><a class="a_button" href="javascript:;" onClick="edit({$vo.id});">编辑</a>
          </div></td>
        </tr>
        </foreach>
        </tbody>
  </table>
</div>

<!-- 分页 -->
<div class="page">
  <div align="center">{$page} </div>
</div>


</body>
</html>
